'''
    to test how GIL affect thread performance
'''
from datetime import datetime
from threading import Thread

def count(n):
    while n>0:
        n-=1

COUNT=100000000   #100 million times

thread1=Thread(target=count, args=(COUNT/2,))
thread2=Thread(target=count, args=(COUNT/2,))
thread1.start()
thread2.start()
thread1.join()
thread2.join()

#count(COUNT)
#add more threads to test then see its duration